package com.chen.service;

import com.chen.annotion.Master;
import com.chen.dao.TestDao;
import com.chen.entity.Test;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TestService {

    @Resource
    private TestDao testDao;

    public List<Test> getTestList() {
        System.out.println("slave查询");
        return testDao.listTest();
    }


    @Master
    public List<Test> getTests() {
        System.out.println("master查询");
        return testDao.listTest();
    }

    public int add(Test test) {
        return testDao.insert(test);
    }
}
